home *** CD-ROM | disk | FTP | other *** search
/ 3D Images / 3D Images.iso / programs / amiga / genesis / usinggenesis < prev    next >
Encoding:
Text File  |  1995-02-09  |  10.7 KB  |  195 lines

  1. Instructions on how to use Genesis V2.1
  2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3.  
  4.   This file describes how to use the temporary interface to the
  5. Genesis modelling system. The final version will incorporate a
  6. a complete text parsing system with which will allow models to
  7. be constructed in a more user friendly way, but for the mean time
  8. this preliminary interface is used.
  9.  
  10.   When you invoke Genesis you are put into a mode where anything
  11. you try and type in at the keyboard will be interpreted by Genesis
  12. as a command. Most commands take parameters which follow the
  13. command, if you enter a command that needs parameters but do not
  14. enter any the system will wait until you enter all the information
  15. it is expecting. If you enter a command it doesn't recognise or give
  16. it an invalid parameter it will respond with an appropriate error
  17. message. If you invoke Genesis with the name of a file it will read
  18. this file which should be a list of valid genesis commands. It will
  19. process this as if you typed it all in interactively. If it encounters
  20. an error it will stop processing of the file. Genesis will except
  21. commands in upper, lower or mixed case.
  22.  
  23.            INVOKE USING:     Genesis  <filename>
  24.  
  25. Three types of command are supported:
  26.  
  27.    Node creation commands - When you construct a CSG model you are actually
  28.    (N)                      defining a binary tree in memory, each node of
  29.                             which can be a primitive, or an expression
  30.                             combining two other nodes.
  31.  
  32.    Transform commands     - These can be specified after any node creation
  33.    (T)                      command, and are used to changed the position
  34.                             or orientation of the node just created.
  35.  
  36.    System commands        - These control such things as opening screens,
  37.    (S)                      telling the system which node in the tree
  38.                             to draw and exiting from the system etc.
  39.  
  40. There now follows a reference list of valid Genesis commands. A simple
  41. example of a genesis model follows which will give an idea of how to
  42. combine these commands to build models:
  43.  
  44.                          Command
  45.   Command    Parameters   Type    Description
  46.   ~~~~~~~    ~~~~~~~~~~  ~~~~~~~  ~~~~~~~~~~~
  47.  
  48.   CrPlane    IRRR           N   Parms: node_id  xn  yn  zn
  49.                                   Creates a plane at the origin where
  50.                                   xn,yn,zn is a normal vector to its surface
  51.                                   pointing towards the empty side of space
  52.   CrSphere   IR             N   Parms: node_id radius
  53.                                   Creates a sphere at the origin
  54.   CrCylind   IR             N   Parms: node_id  radius
  55.                                   Creates an infinitely long cylinder at
  56.                                   the origin aligned with the z axis
  57.   CrCone     IR             N   Parms: node_id  half_angle (in degrees)
  58.                                   Creates an infinitely long double cone
  59.                                   at the origin aligned with the z axis
  60.   CrEllip    IRRR           N   Parms: node_id  smx  smy  smz
  61.                                   Creates an ellipsoid at the origin with
  62.                                   the semi-major axis lengths given by
  63.                                   smx, smy and smz
  64.   CrSolid    I              N   Parms: node_id
  65.                                   Creates an entirely SOLID universe
  66.   CrEmpty    I              N   Parms: node_id
  67.                                   Creates an entirely EMPTY universe
  68.   CrExpr     IICI           N   Parms: node_id  node1_id  expr  node2_id
  69.                                   Combines two nodes using an operator
  70.                                   Valid operators are:
  71.                                             + : Take union of nodes
  72.                                             * : Take intersection of nodes
  73.                                             - : Subtract node2 from node1
  74.                                   Eg. CrExpr 3 1 * 2  makes node 3 equal
  75.                                   to the intersection of nodes 1 and 2
  76.   XRot       R              T   Parms: angle (degrees)
  77.                                   This is a transform type. It rotates the
  78.                                   previously created node in the x axis
  79.   YRot       R              T   Parms: angle (degrees)
  80.                                   Rotates the previously created noe in the
  81.                                   y axis
  82.   ZRot       R              T   Parms: angle (degrees)
  83.                                   Rotates the previously created noe in the
  84.                                   y axis
  85.   Trans      RRR            T   Parms: x_offset  y_offset  z_offset
  86.                                   Moves the previously created node and its
  87.                                   sub-nodes to a new position
  88.   Scale      R              T   Parms: factor
  89.                                   Scales the previously created node and its
  90.                                   sub-nodes by a factor
  91.   Draw       I              S   Parms: node_id
  92.                                   Draws the object at node_id on the current
  93.                                   screen
  94.   Start      S              S   Parms: filename
  95.                                   Reads subsequent commands from a file.
  96.                                   NB. CANNOT BE ISSUED FROM A FILE, ie. nested
  97.                                   starts are not possible
  98.   Exit       -              S   Parms: (No parameters)
  99.                                   Exits from a command file, or if typed in
  100.                                   directly, exits the Genesis system
  101.   Open       IIS            S   Parms: screen_id  resolution  colour
  102.                                   Opens a screen and makes it current. The
  103.                                   resolution can currently be between 4 and
  104.                                   9, (NB. size 8 means 2**8 by 2**8 or 256
  105.                                   square). Colour must be one of;
  106.                                      Red      Cyan     White
  107.                                      Green    Magenta  Black
  108.                                      Blue     Yellow
  109.   Close      I              S   Parms: screen_id
  110.                                   Closes a screen. Another will be selected
  111.                                   by the system to be made current
  112.   Screen     I              S   Parms: screen_id
  113.                                   Make a different screen current (ie. The one
  114.                                   that will be rendered on).
  115.   Reset      -              S   Parms: (no parameters)
  116.                                   Removes the entire model from memory
  117.   Size       I              S   Parms: size
  118.                                   Sets the size of the space in which
  119.                                   Genesis will render. Eg. size 8 means it
  120.                                   will render a 256 x 256 x 256 cube. You
  121.                                   must ensure that the current screen is at
  122.                                   least this size to be able to display it.
  123.   Camera     RRR            S   Parms: x  y  z
  124.                                   Sets the position of the camera
  125.   Object     RRR            S   Parms: x  y  z
  126.                                   Sets the position at which the camera
  127.                                   is looking
  128.   Up         RRR            S   Parms: x  y  z
  129.                                   Sets the 'up' direction in the final image
  130.   Window     RRR            S   Parms: x  y  z
  131.                                   Defines a box of dimensions x,y,z around
  132.                                   the object position which contains
  133.                                   everything that will be rendered by the
  134.                                   system
  135.   Persp      S              S   Parms: On/Off
  136.                                   Tells system wether perspective is to
  137.                                   be used. Parameter must be either 'on' or
  138.                                   'off'.
  139.  KEY:
  140.   | R : Real value     | N : Node creation command |
  141.   | I : Integer value  | T : Transform command     |
  142.   | S : String         | S : System command        |
  143.   | C : Character      |                           |
  144.   | - : (no parameters)|                           |
  145.  
  146. If, when rendering a model, you find you have large white areas in your
  147. picture, this is because part of the object being rendered comes closer
  148. to the camera (or viewpoint) than the front face of the universe. In other
  149. words Genesis will only render things within a defined volume. If this
  150. hasn't been changed by the use of the WINDOW, PERSP, OBJECT or CAMERA
  151. commands, then you will be using the default universe, which is a cube
  152. with its bottom, left, front corner at the origin and extending to 256
  153. units along the x, y and z axis. Anything within this volume will be rendered,
  154. but if any part of the object comes closer to the viewpoint than z=0
  155. (ie. negative z, as we are using a left handed coordinate system), it will
  156. appear as a featureless white area.
  157.  
  158. The following example will construct a cube with a cylindrical hole
  159. drilled through the front of it;
  160.  
  161.       Open 0 8 blue                           (opens a blue size 8 screen)
  162.  
  163.       CrPlane 1  1  0  0 trans  1  0  0       (creates six half planes for
  164.       CrPlane 2 -1  0  0 trans -1  0  0        the edges of the cube.
  165.       CrPlane 3  0  1  0 trans  0  1  0        NB. Each one has a different
  166.       CrPlane 4  0 -1  0 trans  0 -1  0        normal and is moved an
  167.       CrPlane 5  0  0  1 trans  0  0  1        offset from the origin or
  168.       CrPlane 6  0  0 -1 trans  0  0 -1        the centre of the cube)
  169.  
  170.       CrExpr  7  1 * 2                        (All these half planes are
  171.       CrExpr  8  3 * 4                         intersected in a hierachy
  172.       CrExpr  9  5 * 6                         to form a cube at the origin
  173.       CrExpr 10  7 * 8                         at node 11)
  174.       CrExpr 11 10 * 9
  175.  
  176.       CrCylind 12 0.5                         (Creates the small cylinder)
  177.  
  178.       CrExpr 13 11 - 12 XRot -30 YRot 20      (Subtract it from the cube,
  179.                         Scale 30               rotate this object to get a
  180.                         Trans 128 128 128      good view, scale it to a good
  181.                                                size, and then move it to the
  182.                                                centre of the cube)
  183.       Draw 13                                 (Draw the object at node 13)
  184.  
  185. I suggest you try typing in the above to get a feel for how to use
  186. the system as it currently stands, or even just edit it out of this
  187. file and run it on the modeller (but remember to remove the comments).
  188. In the final version of the modeller all this will be able to be
  189. replaced by;
  190.  
  191.       Open 0 8 blue
  192.       Draw (
  193.              Cube(1,1,1) subtract Cylinder(0.5)
  194.            ) XRot(-30) YRot(20) Scale(30) At(128,128,128).
  195.